package drawingBoard.memento;

import java.awt.image.BufferedImage;

public class Originator {
    private BufferedImage state;

    public void setState(BufferedImage state){  //setter
        this.state = state;
    }

    public BufferedImage getState(){  //getter
        return state;
    }

    public Memento saveStateToMemento(){  //保存状态至备忘录
        return new Memento(state);
    }

    public void getStateFromMemento(Memento Memento){
        state = Memento.getState();  //从备忘录获取状态
    }
}